refactor(ui): extract extension runtime lifecycle - #882
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR extracts extension command execution, event-context installation, and runtime capability lifecycle management from
Confidence Score: 4/5The PR appears safe to merge, with only a non-blocking test-fixture typing issue to address. The extracted runtime lifecycle preserves committed-state ordering and stale-capability retirement, while the only accepted concern is that new tests bypass structural fixture checking through empty-object type assertions. Files Needing Attention: src/ui/hooks/useExtensionCommandRunner.test.tsx and src/ui/hooks/useExtensionEventContextProvider.test.tsx Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
App[App render] --> Bridge[Extension runtime bridge]
App --> Runner[Command runner]
App --> Provider[Event context provider]
App --> Bindings[Command and navigation bindings]
Bindings -->|layout commit| Bridge
Bridge --> Lease[Registry and review leases]
Bridge --> Projection[Committed and render projections]
Runner --> Context[Extension command context]
Provider --> Events[Lifecycle and custom events]
Lease -->|reload or unmount| Retired[Retired controls become inert]
Prompt To Fix All With AI### Issue 1
src/ui/hooks/useExtensionCommandRunner.test.tsx:20
**Partial mocks bypass typing**
The new hook tests construct partial extension-capability fixtures with `{} as ...` assertions instead of the required `@total-typescript/shoehorn` helpers. This bypasses structural checking and allows capability contracts to change without useful compile-time failures; the same pattern appears in `useExtensionEventContextProvider.test.tsx`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(ui): isolate extension runtime ..." | Re-trigger Greptile |
| import { createEmptyExtensionLoadResult, type RegisteredCommand } from "../../extensions/types"; | ||
| import { useExtensionCommandRunner } from "./useExtensionCommandRunner"; | ||
|
|
||
| const commandControls = {} as ExtensionCommandControls; |
There was a problem hiding this comment.
The new hook tests construct partial extension-capability fixtures with {} as ... assertions instead of the required @total-typescript/shoehorn helpers. This bypasses structural checking and allows capability contracts to change without useful compile-time failures; the same pattern appears in useExtensionEventContextProvider.test.tsx.
Context Used: testing.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/hooks/useExtensionCommandRunner.test.tsx
Line: 20
Comment:
**Partial mocks bypass typing**
The new hook tests construct partial extension-capability fixtures with `{} as ...` assertions instead of the required `@total-typescript/shoehorn` helpers. This bypasses structural checking and allows capability contracts to change without useful compile-time failures; the same pattern appears in `useExtensionEventContextProvider.test.tsx`.
**Context Used:** testing.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/testing.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
acd7b42 to
b0b60d1
Compare
55e431c to
8bde834
Compare
559cd22
into
refactor/extension-pane-controller
Summary
AppTesting
bun run typecheckbun run deps:checkbun run lintStack
This PR description was generated by Pi using GPT-5.6 Sol